﻿using System;
using System.Collections.Generic;

namespace Opo.Perspective.Core
{
    /// <summary>
    /// Represents a service for accessing data
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IService<T>
    {
        /// <summary>
        /// Adds the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        T Add(T entity);
        /// <summary>
        /// Gets the entity specified by the id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        T Get(Guid id);
        /// <summary>
        /// Gets all entities.
        /// </summary>
        /// <returns></returns>
        IList<T> GetAll();
        /// <summary>
        /// Updates the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        T Update(T entity);
        /// <summary>
        /// Deletes the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        void Delete(T entity);
    }
}
